package com.LostAndFound.dao;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;

import com.LostAndFound.domain.Root;
import com.LostAndFound.utils.DataSourceUtils;

public class PersonalDao {

	public int handleUpdatePersonalInfo(Root root) throws SQLException {
		QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
		String sql = "update root set password=?,gender=?,cellphone=?, "
				+ " email=?,realname=?,resume=? where rid=?";
		Object[] params = {root.getPassword(),root.getGender(),root.getCellphone(),
				root.getEmail(),root.getRealname(),root.getResume(),root.getRid()};
		int update = runner.update(sql, params);
		return update;
	}

}
